﻿// DigitalDesign
// Project: InformationBoard
// Developer: Montak Oleg
// Created: 14.11.2011
// Last change: 16.11.2011
// Description: wrapper-classes for transfer to an entity on the client

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Server
{
    [DataContract]
    public class wScheduleChanxNode
    {
        #region constructors
        public wScheduleChanxNode()
        {
            Location = new wLocation();
        }

        public wScheduleChanxNode(ScheduleChanx changes)
        {
            Location = new wLocation(changes.Location);
            Id = changes.Id;
            DateOfChange = changes.DateOfChange;
            TimeOfLanding = changes.TimeOfLanding;
            TimeOfDeparture = changes.TimeOfDeparture;
            StationOfDestination = changes.StationOfDestination;
            NumberOfTransport = changes.NumberOfTransport;
            ScheduleId = changes.ScheduleId;
            Canceled = changes.Canceled;
            LocationId = Location.Id;
        }
        #endregion

        #region data members
        [DataMember]
        public int Id { get; set; }

        [DataMember]
        public DateTime DateOfChange { get; set; }

        [DataMember]
        public TimeSpan TimeOfLanding { get; set; }

        [DataMember]
        public TimeSpan TimeOfDeparture { get; set; }

        [DataMember]
        public string StationOfDestination { get; set; }

        [DataMember]
        public string NumberOfTransport { get; set; }

        [DataMember]
        public bool Canceled { get; set; }

        [DataMember]
        public int? ScheduleId { get; set; }

        [DataMember]
        public wLocation Location { get; set; }

        [DataMember]
        public int LocationId { get; set; }
        #endregion
    }
}
